package org.southyin.springboot02.controller;

import org.southyin.springboot02.model.CmsCategory;
import org.southyin.springboot02.service.CmsCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/category")
@CrossOrigin(value = "http://127.0.0.1:5500",allowCredentials = "true")
public class CategoryController {
    @Autowired
    CmsCategoryService service;
    @GetMapping("/list")
    public List<CmsCategory> list() {
        return service.listCmsCategory();
    }
}
